package com.ruoyi.back.controller

import com.ruoyi.app.common.Data
import com.ruoyi.app.common.PageData
import com.ruoyi.back.domain.MemberNotice
import com.ruoyi.back.service.MemberNoticeService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("system/memberNotice")
@Api(tags = ["会员通知"])
class MemberNoticeController {

    @Autowired
    private lateinit var memberNoticeService: MemberNoticeService


    @ApiOperation("保存会员提示")
    @PostMapping("save")
    fun saveMemberNotice(@RequestBody memberNotice: MemberNotice): Data<Boolean> =
        memberNoticeService.saveMemberNotice(memberNotice)

    @ApiOperation("会员分页")
    @GetMapping("page")
    fun memberNoticePage(): PageData<MemberNotice> = memberNoticeService.memberNoticePage()

    @ApiOperation("批量移除会员通知")
    @GetMapping("remove/{ids}")
    fun removeMemberNotice(@PathVariable ids: String): Data<Boolean> = memberNoticeService.removeMemberNotice(ids)
}